package face.pay.job.config.rocket;

import com.aliyun.openservices.ons.api.PropertyKeyConst;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Properties;

/**
 * @Auther: zkj
 * @Date: 2019/8/2 11:07
 * @Description:
 */
@Component
public class MqConfig {

    @Value("${aliyun.accessKey}")
    private String accessKey;

    @Value("${aliyun.secretKey}")
    private String secretKey;

    @Value("${rocket.mq.groupId}")
    private String groupid;

    /**
     * 主题
     */
    @Value("${rocket.mq.orderTopic}")
    private String orderTopic;

    /**
     * 订单回调
     */
    @Value("${rocket.mq.callBackOrderTopic}")
    private String callBackOrderTopic;


    @Value("${rocket.mq.sharingTopic}")
    private String sharingTopic;
    /**
     * 分类
     */
    @Value("${rocket.mq.profitTag}")

    private String profitTag;

    @Value("${rocket.mq.backTag}")
    private String backTag;

    @Value("${rocket.mq.sharingTag}")
    private String sharingTag;

    /**
     * 接入地址
     */
    @Value("${rocket.mq.namesrvAddr}")
    private String namesrvAddr;


    public Properties getMqPropertie() {
        Properties properties = new Properties();
        properties.setProperty(PropertyKeyConst.AccessKey, this.accessKey);
        properties.setProperty(PropertyKeyConst.SecretKey, this.secretKey);
        properties.setProperty(PropertyKeyConst.NAMESRV_ADDR, this.namesrvAddr);
        return properties;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getGroupid() {
        return groupid;
    }

    public void setGroupid(String groupid) {
        this.groupid = groupid;
    }

    public String getNamesrvAddr() {
        return namesrvAddr;
    }

    public void setNamesrvAddr(String namesrvAddr) {
        this.namesrvAddr = namesrvAddr;
    }

    public String getOrderTopic() {
        return orderTopic;
    }

    public void setOrderTopic(String orderTopic) {
        this.orderTopic = orderTopic;
    }

    public String getProfitTag() {
        return profitTag;
    }

    public void setProfitTag(String profitTag) {
        this.profitTag = profitTag;
    }

    public String getCallBackOrderTopic() {
        return callBackOrderTopic;
    }

    public void setCallBackOrderTopic(String callBackOrderTopic) {
        this.callBackOrderTopic = callBackOrderTopic;
    }

    public String getBackTag() {
        return backTag;
    }

    public void setBackTag(String backTag) {
        this.backTag = backTag;
    }

    public String getSharingTopic() {
        return sharingTopic;
    }

    public void setSharingTopic(String sharingTopic) {
        this.sharingTopic = sharingTopic;
    }

    public String getSharingTag() {
        return sharingTag;
    }

    public void setSharingTag(String sharingTag) {
        this.sharingTag = sharingTag;
    }

    @Override
    public String toString() {
        return "MqConfig{" +
                "accessKey='" + accessKey + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", groupid='" + groupid + '\'' +
                ", orderTopic='" + orderTopic + '\'' +
                ", callBackOrderTopic='" + callBackOrderTopic + '\'' +
                ", sharingTopic='" + sharingTopic + '\'' +
                ", profitTag='" + profitTag + '\'' +
                ", backTag='" + backTag + '\'' +
                ", sharingTag='" + sharingTag + '\'' +
                ", namesrvAddr='" + namesrvAddr + '\'' +
                '}';
    }
}
